-
Notifications
You must be signed in to change notification settings - Fork 257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add block cache trait #1192
Add block cache trait #1192
Conversation
ba0b06b
to
7441a69
Compare
94d5f5e
to
e7003ee
Compare
e4b7044
to
523b152
Compare
…` with methods for managing a block cache.
523b152
to
1b4e5fa
Compare
This looks ready to go! What's the protocol for approving a workflow? |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1192 +/- ##
==========================================
+ Coverage 63.59% 63.76% +0.16%
==========================================
Files 121 121
Lines 13945 14009 +64
==========================================
+ Hits 8869 8933 +64
Misses 5076 5076 ☔ View full report in Codecov by Sentry. |
… tokio deps and moved tokio rt-multi-thread feature to dev-dependencies
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK modulo documentation for short reads, if they are allowed.
- Added read error documentation - Changed name of `cache_tip` method to `get_tip_height` - Improved doc comments
97611f1
to
ea991b7
Compare
Oh hi! What needs to be done to approve this workflow? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK
I think this is ready to land. I think @Oscar-Pepper has already addressed @str4d 's requested changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed c62b5b2
…nd replace with async trait
It looks like this workflow is ready to be kicked... |
Hi @str4d I've made the requested changes and it's ready for review again |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed as of 7301c0c.
|
||
/// Inserts a vec of compact blocks into the block cache. | ||
/// | ||
/// Returns `Ok(())` on success, otherwise returns an error. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Document whether this should return an error if the blocks aren't contiguous. It probably doesn't matter here if they aren't, but we should make sure devs are clear on what the expected behaviour is here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not want to constrain an insert to a contiguous range of blocks and i will make that clear in the doc comment. I dont fully recall off the top of my head but there was a case where I realised, either from your current implemenation or a potential future optimisation, where it may be beneficial to be able to insert non-sequential ranges in one call.
Hi @str4d, thanks for the review, I have replied to and made all requested changes except for adding I have sent for review again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK. There are some further changes I want to make (like placing this behind a feature flag), but I can do that when I rebase #1184 on top of this.
Adds a
BlockCache
trait forBlockSource
which aims to generalise the block source for consumers who are not implementing an SQLite database. This lays some of the groundwork for #1184 by removing cyclic dependencies and generalising the sync engine for wallets with different implementationsCloses #1170